home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / mus / midi / MusicXRexxMacs.lha / macros / FLIP.mxe < prev    next >
Text File  |  1997-02-04  |  742b  |  51 lines

  1.  
  2. /*  Flip notes around an axis*/
  3.  
  4. /* © Dick Doyle */
  5.  
  6. options results                        
  7.  
  8.  
  9. MXSLIDER "Axis:,0,127,60"
  10. MXRADIO "Selected Notes,All Notes"    
  11. MXSLIDER "Channel Select,1,16,1"
  12. MXREQUEST "FLIP,Flip"  
  13. if result == 0 then exit                        
  14.  
  15. MXPOINTER "sleepy"                        
  16. MXVALUE 1                                
  17. rotor = result
  18.  
  19. MXVALUE 3
  20. chanum = result
  21.  
  22. MXVALUE 2                                
  23. if result == 0 then BEGINSCAN 'selected'
  24. else BEGINSCAN 'all'    
  25.  
  26. if result ~= 0 then do forever    
  27.  
  28.   NEXTEVENT                                
  29.   if result == 0 then break
  30.  
  31.       if EVENT.CHANNEL == chanum - 1 then
  32.  
  33.       if  EVENT.TYPE == 'NOTE' then  
  34.  
  35.       if event.num ~= rotor then do 
  36.       newval = rotor - (event.num - rotor)
  37.  
  38.     
  39. EVENT.NUM = newval   
  40.  
  41. REPLEVENT
  42.  
  43.  end    
  44.  end    
  45.  
  46.  
  47. ENDSCAN
  48.  
  49. MXPOINTER "normal"                        
  50. exit
  51.